<?php
//https://developers.facebook.com/docs/php/howto/example_facebook_login
require_once __DIR__ . '/config.php';

$helper = $fb->getRedirectLoginHelper();

$permissions = ['email']; // Optional permissions
$loginUrl = $helper->getLoginUrl('http://'. $_SERVER['HTTP_HOST'] .'/facebook/fb-callback.php', $permissions);

echo '<a href="' . htmlspecialchars($loginUrl) . '">Log in with Facebook!</a>';
